package org.openmore.consumer.service.feign;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.openmore.consumer.dto.common.BaseResponse;
import org.openmore.consumer.dto.common.LoginParams;
import org.openmore.consumer.service.feignImpl.AccountServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

@Service
@FeignClient(value = "openmore-opc", fallbackFactory = AccountServiceImpl.class)
public interface AccountService {

    /**手机号或密码登录*/
    @RequestMapping(method = RequestMethod.POST, value = "/api/account/{tenantId}/login")
    BaseResponse login(@PathVariable @ApiParam(value = "应用ID") String tenantId,
                       @RequestBody LoginParams params);
    /*退出登录*/
    @RequestMapping(method = RequestMethod.GET, value = "/api/account/logout")
    BaseResponse logout();
}
